﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="DVDWeek.aspx.cs" Inherits="DVDWeek" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:DatabaseConnectionString %>" 
        
        SelectCommand="SELECT Movie.MovieID, Movie.Title, Movie.Description, Movie.Length, Movie.Director, Category.Name AS Category, Movie.Rating FROM Movie INNER JOIN CategoryMovie ON Movie.MovieID = CategoryMovie.MovieID INNER JOIN Category ON CategoryMovie.CategoryID = Category.CategoryID WHERE (Movie.MovieOfTheWeek = 1) GROUP BY Movie.Title, Movie.Description, Movie.Length, Movie.Director, Category.Name, Movie.Rating, Movie.MovieID">
    </asp:SqlDataSource>
    <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
        DataKeyNames="MovieID" DataSourceID="SqlDataSource1" Height="50px" 
        Width="835px">
        <Fields>
            <asp:HyperLinkField DataNavigateUrlFields="MovieID" 
                DataNavigateUrlFormatString="~/Movie.aspx?MovieID={0}" DataTextField="Title" 
                HeaderText="Title" />
            <asp:BoundField DataField="Description" HeaderText="Description" 
                SortExpression="Description" />
            <asp:BoundField DataField="Length" HeaderText="Length" 
                SortExpression="Length" />
            <asp:BoundField DataField="Director" HeaderText="Director" 
                SortExpression="Director" />
            <asp:BoundField DataField="Category" HeaderText="Category" 
                SortExpression="Category" />
            <asp:BoundField DataField="Rating" HeaderText="Rating" 
                SortExpression="Rating" />
        </Fields>
    </asp:DetailsView>
</asp:Content>

